<template>
    <view v-if="id&&text">
        <web-view :src="url" />
    </view>
</template>

<script>
export default {
    data() {
        return {
            id:uni.getStorageSync('business').businessId,
            text:uni.getStorageSync('textList'),
            url: `https://www.diandianyouke.cn:8080/html/index.html?timestamp=${new Date().getTime()}&id=${this.id}&text=${JSON.stringify(this.text)}`
        };

        
    },

    onLoad(e) {
        if(e.text){
            if(e.text=='oneClick'){
                this.text = []
            }else{
                this.text = JSON.parse(e.text)
            }
        }
        this.url = encodeURI(`https://www.diandianyouke.cn:8080/html/index.html?timestamp=${new Date().getTime()}&id=${this.id}&text=${JSON.stringify(this.text)}`)
        console.log(this.url);
        this.getNav()
    },

    methods: {
        getNav(){
            uni.setNavigationBarTitle({title: '封面设置',})
        },
    },
};
</script>

<style lang="scss" scoped>

</style>